{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# State Action Value Function Example\n",
    "\n",
    "In this Jupyter notebook, you can modify the mars rover example to see how the values of Q(s,a) will change depending on the rewards and discount factor changing."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "from utils import *"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Do not modify\n",
    "num_states = 6\n",
    "num_actions = 2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "terminal_left_reward = 100\n",
    "terminal_right_reward = 40\n",
    "each_step_reward = 0\n",
    "\n",
    "# Discount factor\n",
    "gamma = 0.5\n",
    "\n",
    "# Probability of going in the wrong direction\n",
    "misstep_prob = 0"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAqsAAACNCAYAAACQcTPzAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+j8jraAAAczklEQVR4nO3deXxU1f3/8dcJSYCQAAmEyKJAZBNQiAtIxYbFilYFv0i/tRV/Yt1qFSuiVr+gtYrbF3GpLYqAWMUN6tdCwZ0l4IIVZN8k7DtEQgiELCTn98dMxiQzSSYkmbk3eT8fj3nAnHvuvZ+bz+POfObMuXeMtRYRERERESeKCHcAIiIiIiLlUbEqIiIiIo6lYlVEREREHEvFqoiIiIg4lopVEREREXEsFasiIiIi4lgqVkUkLIwxlxtjPjbG/GiMyTXG/GCMedYYE1+Nbd5rjBkeoP0xY0zI79MXxv3uMMa8UeL5KGOMNcZ0CHUsIiLVpWJVRELOGPM/wK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ixIl07NiRV155hXnz5vH1119z/vnnh+sQgzZgwAAAFi9eHNY4atKJEyfo1asXjRs3ZsKECRhjeOSRR8jOzmbNmjV15tOkcuduyp+71bX8KXfuZ4xh3LhxTJgwAaBKtYzbGGNWWGsv9FsQ6Oar1oU/CmCttUDAR8mbBP/444/25ptvtvHx8bZx48Z20KBBdtWqVX7bysnJsWPGjLFJSUm2YcOGtk+fPnbRokWhO5hqqks3Ry5p586ddvjw4TYuLs7GxsbaYcOG+f34g9spd+6m/LlbXcyfcudulPlRAGuDr2XchnJ+FKBOjazKT+rqJ8z6QLlzN+XP3ZQ/91Lu3K+8kdV6NWdVRERERNxFxaqIiIiIOJaKVRERERFxLBWrIiIiIuJYKlZFRERExLFUrIqIiIiIY6lYFRERERHHUrEqIiIiIo6lYlVEREREHEvFqoiIiIg4lopVEREREXEsFasiIiIi4lgqVkVERETEsVSsioiIiIhjqVgVEREREcdSsSoiIiIijqViVUREREQcS8WqiIiIiDiWilURERERcSwVqyIiIiLiWCpWRURERMSxVKyKiIiIiGMZa235C405DOwMXTgiIiIiUk+1t9Ymlm2ssFgVEREREQknTQMQEREREcdSsSoiIiIijqViVUREREQcS8WqiIiIiDiWilURERERcaz/DwdieKbt7VBjAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 864x144 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAA/oAAACNCAYAAAAHKQFFAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+j8jraAAAe4UlEQVR4nO3deXhV1bnH8d/CzANDCCBDJQQScDYVQZASkBaktmKRe/URrVgLigjKYK9tuaKC1LaCAk4UEFtFsTgBKhZllkGGi4AVAoRB5jGEJJB53T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aj/88IMdNGiQvfzyy21gYKC94oor7IgRI+ypU6dqumu1GrFZNYjPqkdsVg1i0z+Iz6pBfFY9YrNyinKoGTNmeJ1+KfkSPEnaaL3k8sYW/nSBN5GRkTYtLc3/RxuACurRo4ckafny5TXaD6AkYhNORWzCyYhPOBWxCaczxmyy1nYsWc49+gAAAAAAuAiJPgAAAAAALkKiDwAAAACAi5DoAwAAAADgIiT6AAAAAAC4CIk+AAAAAAAuQqIPAAAAAICLkOgDAAAAAOAiJPoAAAAAALgIiT4AAAAAAC5Cog8AAAAAgIuQ6AMAAAAA4CIk+gAAAAAAuAiJPgAAAAAALkKiDwAAAACAi5DoAwAAAADgIiT6AAAAAAC4CIk+AAAAAAAuQqIPAAAAAICLkOgDAAAAAOAiJPoAAAAAALiIsdaWPdGYE5L2V193AAAAAACAj1pba5uULCw30QcAAAAAALULl+4DAAAAAOAiJPoAAAAAALgIiT4AAAAAAC5Cog8AAAAAgIuQ6AMAAAAA4CL/D/SIEehfaXzVAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 1296x144 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "generate_visualization(terminal_left_reward, terminal_right_reward, each_step_reward, gamma, misstep_prob)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
